class Solution:
    def finalValueAfterOperations(self, operations: List[str]) -> int:
        operation = {"X++" : 1, "++X": 1, "--X": -1, "X--": -1}
        res = 0
        for x in operations:
            res += operation[x]
        return res